<!-- <template>
    <div>
        <XDRadio v-model="radio" :list="list"></XDRadio>
        <el-dialog
                width="50%"
                title=""
                :visible.sync="innerVisible"
                append-to-body>
                        <EleTableComp :config="config" @handleCurrentChange="handleCurrentChange"></EleTableComp>
        </el-dialog>
    </div>
</template>
<script>
    import XDRadio from "./XDRadio";
    import {typeJson} from "../config";
    import XDInput from "./XDInput";
    import EleTableComp from "../EleTableComp";
    export default {
        name: 'XDRelative',
        data() {
            return {
                radio: true,
                list: typeJson.bool,
                innerVisible: false,
                show: [
                    {
                        label: "",
                        prop: "",
                        value: ""
                    },
                    {
                        label: "",
                        prop: "",
                        value: ""
                    }
                ],
                config: {
                    header: {
                        addButton: false,
                        addButtonSlot: '',
                        search: [
                            {
                                type: 'dropDown',
                                list: typeJson.riskRule,
                                prop: 'riskRule',
                                value: 1,
                                label: '隐患发现方式'
                            },
                        ]
                    },
                    footer: {
                        pagination: true
                    },
                    table: [
                        {
                            label: '检查部位',
                            prop: 'examPlace',
                            value: '',
                        },
                        {
                            label: '组织单位或人员',
                            prop: 'examMan',
                            value: '',
                        },
                        {
                            label: '隐患数量',
                            prop: 'dangerInfo',
                            value: '',
                        },
                        {
                            label: '检查时间',
                            prop: 'examDate',
                            value: '',
                        },
                    ],
                    select: {
                        url: '/dailyExam/getList',
                        method: 'POST',
                        mineId: false,
                        companyId: false,
                        currentPage: 1,
                        pageSize: 10
                    },
                }
            }
        },
        components: {
            XDInput,
            XDRadio,
            EleTableComp
        },
        methods: {
            // 完成点击
            handleCurrentChange() {
                this.innerVisible = false
            },
            // 获取参数
            getQueryVariable(variable) {
                let href = window.location.href
                let query = href.substring(href.indexOf('?')+1);
                let vars = query.split("&");
                for (var i = 0; i < vars.length; i++) {
                    let pair = vars[i].split("=");
                    if (pair[0] == variable) {
                        return pair[1];
                    }
                }
                return (false);
            },
        },
        watch: {
            "radio": function () {
                if(this.radio == true) {
                    this.innerVisible = true
                }
            },
            $route: function (newVal) {
                if (!this.getQueryVariable('riskRule')) { return }
                    switch(this.getQueryVariable('riskRule')) {
                        case "1":
                            this.config.select = {
                                url: '/dailyExam/getList',
                                method: 'POST',
                                mineId: false,
                                companyId: false,
                                currentPage: 1,
                                pageSize: 10
                            }
                        case "2":
                            this.config.select = {
                                url: '/specialExam/getList',
                                method: 'POST',
                                mineId: false,
                                companyId: false,
                                currentPage: 1,
                                pageSize: 10
                            }
                        case "3":
                            this.config.select = {
                                url: '/superiorExam/getList',
                                method: 'POST',
                                mineId: false,
                                companyId: false,
                                currentPage: 1,
                                pageSize: 10
                            }
                    }
            }
        }
    }
</script> -->